package demo8;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;
public class XunHuan {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean flag = true;
        while (flag){
            System.out.println("输入任意数据打印当前时间,输入“n”退出");

            String v = scanner.next();
            if (v.equals("n")) {
                flag = false;
                break;
            }else {

                LocalDateTime localDateTime = LocalDateTime.now();
                System.out.println(localDateTime);
                System.out.println("------------------------------------------------");
                DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
                System.out.println(dateTimeFormatter.format(LocalDateTime.now()));
            }
        }
    }

}
